package com.whx.managea.service.impl;

import com.whx.managea.dao.CityDAO;
import com.whx.managea.entity.City;
import com.whx.managea.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class CityServiceImpl implements CityService {

    @Autowired
    private CityDAO cityDAO;

    @Override
    public List<City> findAll() {
        return cityDAO.findAll();
    }

    @Override
    public void save(City city) {
        city.setCreatetime(new Date());
        city.setNumbers(0);
        cityDAO.save(city);

    }
}
